<?php
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_time_limit(30);
mb_internal_encoding("UTF-8");
date_default_timezone_set("Asia/Chongqing");

$arr = array_keys($_GET);
if(!isset($arr[0])) exit("0x0");
$id = intval($arr[0]);
if(!$id) exit("0x1");

require 'runtime.php';
$db = init_db();
$row = $db->get_row("select id,server,weights,content from weather_server where id={$id}");
$server_url = $row["server"];
$server_url = str_replace("{action}", "101270501", $server_url);

$data = file_get_contents($server_url);
echo $data;exit;
$data = base64_decode($data);
$data = gzuncompress($data);
$data = unserialize($data);
echo "<pre>";
print_r($data);
echo "</pre>";
?>
